import axios from "../index.js";
// 应急到岗到位
// 列表
export const getListApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/listPage",
    method: "post",
    data: data
  });
};

// 新增
export const addApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/save",
    method: "post",
    data: data
  });
};
// 提交
export const submitApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/submit",
    method: "post",
    data: data
  });
};

// 编辑
export const updateApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/updById",
    method: "post",
    data: data
  });
};

// 获取详情
export const getByIdApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/getById",
    method: "get",
    data: data
  });
};

// 获取全部响应命令单
export const getAllResponseApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyResponse/getList",
    method: "post",
    data: data
  });
};

// 删除
export const delApi = (id) => {
  return axios.request({
    url: `/emergency/emergencyArrivePost/deleteById/${id}`,
    method: "get"
    // data: data
  });
};

// 获取人员选择
export const getPersonsApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/getStandardList",
    method: "post",
    data: data
  });
};
// 导出
export const exportFileApi = (data) => {
  return axios.request({
    url: "/emergency/emergencyArrivePost/exportData",
    method: "post",
    data: data,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
    responseType: "blob"
  });
};
// 已发布命令单数据接口
export const GetResponse = (data) => {
  return axios.request({
    url: "/emergency/emergencyResponse/selectResponse",
    method: "get",
    data: data
  });
};
